<%@ page contentType="text/html" pageEncoding="UTF-8"%>
<%@ include file="../header.jsp"%>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>${systemName }</title>
    <link rel="shortcut icon" href="${contextPath}/resources/favicon.ico"> 
    <link href="${contextPath}/resources/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="${contextPath}/resources/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <!-- Data Tables -->
    <link href="${contextPath}/resources/css/plugins/dataTables/dataTables.bootstrap.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/animate.min.css" rel="stylesheet">
    <link href="${contextPath}/resources/css/style.min.css?v=4.1.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox-content">
        <form action="${contextPath}/system/user/list" class="form-horizontal" name="searchFrom"> 
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-content">
                        <table class="table table-striped table-hover dataTables-example">
                            <thead>
                                <tr>
                                    <th>ID</th>
                                    <th>角色</th>
                                    <th>手机号码</th>
                                    <th>昵称</th>
                                    <th>真实姓名</th>
                                    <th>头像</th>
                                    <th>最后修改时间</th>
                                    <th>创建时间</th>
                                    <th>等级</th>
                                </tr>
                            </thead>
                            <tbody>
	                            <c:forEach items="${page.resultRows}" var="user" varStatus="vs">  
								        <tr>  
								             <td>${user.id}</td>  
								             <td>
								             	<c:choose> 
										            <c:when test="${user.role  eq 0}">游客</c:when> 
										            <c:when test="${user.role  eq 1}">普通用户</c:when> 
										            <c:when test="${user.role  eq 2}">创客</c:when> 
										            <c:when test="${user.role  eq 3}">商家</c:when> 
										            <c:when test="${user.role  eq 4}">客服</c:when> 
										            <c:when test="${user.role  eq 5}">管理员</c:when> 
										          </c:choose>
								             </td>  
								             <td>${user.mobile}</td>  
								             <td>${user.name}</td>
								             <td>${user.realName}</td> 
								             <td><img alt="" src="${user.avatar}" width="100" height="100"> </td>
								             <td><fmt:formatDate value="${user.lastModifyTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
								             <td><fmt:formatDate value="${user.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td> 
								             <td>${user.gradeName}</td> 
								         </tr>  
								</c:forEach>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <jsp:include page="../page.jsp">
              <jsp:param value="searchFrom" name="formName" />
        </jsp:include>
        </form>
        </div>
    </div>
    <script src="${contextPath}/resources/js/jquery.min.js?v=2.1.4"></script>
    <script src="${contextPath}/resources/js/bootstrap.min.js?v=3.3.6"></script>
    <script src="${contextPath}/resources/js/plugins/jeditable/jquery.jeditable.js"></script>
    <script src="${contextPath}/resources/js/plugins/dataTables/jquery.dataTables.js"></script>
    <script src="${contextPath}/resources/js/plugins/dataTables/dataTables.bootstrap.js"></script>
    <script src="${contextPath}/resources/js/content.min.js?v=1.0.0"></script>
    <script>
        //$(document).ready(function(){$(".dataTables-example").dataTable();var oTable=$("#editable").dataTable();oTable.$("td").editable("../example_ajax.php",{"callback":function(sValue,y){var aPos=oTable.fnGetPosition(this);oTable.fnUpdate(sValue,aPos[0],aPos[1])},"submitdata":function(value,settings){return{"row_id":this.parentNode.getAttribute("id"),"column":oTable.fnGetPosition(this)[2]}},"width":"90%","height":"100%"})});function fnClickAddRow(){$("#editable").dataTable().fnAddData(["Custom row","New row","New row","New row","New row"])};
    </script>
</body>
</html>
